﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XuZhou.SmartWaterConservancy.HeHu.Waters
{
    public class WaterQualityStation : WaterStationBase
    {
        /// <summary>
        /// 水温(°C)
        /// </summary>
        public double? WaterTemperature { get; private set; }

        /// <summary>
        /// PH值
        /// </summary>
        public double? PH { get; private set; }

        /// <summary>
        /// 溶解氧(mg/L)
        /// </summary>
        public double? DissolvedOxygen { get; private set; }

        /// <summary>
        /// 电导率(μS/cm)
        /// </summary>
        public double? Conductivity { get; private set; }

        /// <summary>
        /// 浊度(NTU)
        /// </summary>
        public double? Turbidity { get; private set; }

        /// <summary>
        /// 活性磷酸盐(mg/L)
        /// </summary>
        public double? DRP { get; private set; }

        /// <summary>
        /// 总磷(mg/L)
        /// </summary>
        public double? TotalPhosphorus { get; private set; }

        /// <summary>
        /// 总氮(mg/L)
        /// </summary>
        public double? TotalNitrogen { get; private set; }

        /// <summary>
        /// 氨氮(mg/L)
        /// </summary>
        public double? AmmoniaNitrogen { get; private set; }

        /// <summary>
        /// 高锰酸钾指数(mg/L)
        /// </summary>
        public double? PermanganateIndex { get; private set; }

        /// <summary>
        /// 最后监测时间
        /// </summary>
        public DateTime? LastMonitoringTime { get; private set; }

        protected WaterQualityStation() : base() { }

        public WaterQualityStation(
            Guid id,
            string code,
            string name,
            string administrativeDivisionCode,
            double longitude,
            double latitude,
            string remark = null)
            : base(id, code, name, WaterStationType.WaterQuality, administrativeDivisionCode, longitude, latitude, remark)
        {
        }

        /// <summary>
        /// 更新水质监测数据
        /// </summary>
        public void UpdateMonitoringData(
            double? waterTemperature,
            double? ph,
            double? dissolvedOxygen,
            double? conductivity,
            double? turbidity,
            double? drp,
            double? totalPhosphorus,
            double? totalNitrogen,
            double? ammoniaNitrogen,
            double? permanganateIndex)
        {
            WaterTemperature = waterTemperature;
            PH = ph;
            DissolvedOxygen = dissolvedOxygen;
            Conductivity = conductivity;
            Turbidity = turbidity;
            DRP = drp;
            TotalPhosphorus = totalPhosphorus;
            TotalNitrogen = totalNitrogen;
            AmmoniaNitrogen = ammoniaNitrogen;
            PermanganateIndex = permanganateIndex;
            LastMonitoringTime = DateTime.Now;
        }
    }
}
